package com.zhxy.exception;

import com.zhxy.utils.Result;
import com.zhxy.utils.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一的异常处理类
 */
@RestControllerAdvice
public class MyException {

@ExceptionHandler
public Result doError(Exception e){
    return new Result(StatusCode.ERROR,e.getMessage());
}

}
